Skip to content

Add support for FPU flag for PDs#404

Open
JDuchniewicz wants to merge 3 commits intoseL4:mainfrom
au-ts:jakub/fpu_flag
Open

Add support for FPU flag for PDs#404
JDuchniewicz wants to merge 3 commits intoseL4:mainfrom
au-ts:jakub/fpu_flag

Conversation

@JDuchniewicz
Copy link
Contributor

In conjunction with seL4/rust-sel4#316 allows for using the fpu flag to specify that a PD can be using the FPU.

@Indanz
Copy link

Indanz commented Dec 11, 2025

There is a good reason why I made the FPU enabled by default.

If you do disable it by default, you better give a big warning that people should compile the code with -mgeneral-regs-only, otherwise they'll get crashes.

@JDuchniewicz JDuchniewicz force-pushed the jakub/fpu_flag branch 2 times, most recently from efe6d3d to 95044b3 Compare December 11, 2025 03:03
Signed-off-by: Jakub Duchniewicz <j.duchniewicz@unsw.edu.au>
@JDuchniewicz
Copy link
Contributor Author

Yes. Now it's enabled by default.

affinity: Word(vcpu.cpu.0.into()),
prio: virtual_machine.priority,
max_prio: virtual_machine.priority,
fpu: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably have a VM fpu attribute here too

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small chance anyone would want to disable the FPU for a VM though.

Also, this wouldn't work for x86, where the flag is used for the host task and the FPU is always enabled for the guest itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it it will be refined at a later step during the system setup as mentioned below:

As discussed offline, fpu: true is fine here. As this function's purpose is to only create what can be inferred from just the ELF, while leaving everything else with reasonable defaults. Refining the TCB will happen at a later step in the caller at

// Step 3-14 Set the TCB parameters and all the various caps that we need to bind to this TCB.

Signed-off-by: Jakub Duchniewicz <j.duchniewicz@unsw.edu.au>
Signed-off-by: Jakub Duchniewicz <j.duchniewicz@unsw.edu.au>
Must be be between 4KiB and 16MiB and be 4K page-aligned. Defaults to 8KiB.
* `cpu`: (optional) set the physical CPU core this PD will run on. Defaults to zero.
* `smc`: (optional, only on ARM) Allow the PD to give an SMC call for the kernel to perform.. Defaults to false.
* `fpu`: (optional) disable the FPU support for this PD. Defaults to true.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `fpu`: (optional) disable the FPU support for this PD. Defaults to true.
* `fpu`: (optional) whether this PD can access the FPU. Defaults to true.

@Ivan-Velickovic
Copy link
Collaborator

Main issue is rust-sel4 PR, otherwise this is pretty trivial.

For now I can merge the FPU changes into our rust-sel4 branch for development, but we'll need to merge that PR before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants